<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>欢迎页面</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <link rel="stylesheet" href="/static/css/font.css">
        <link rel="stylesheet" href="/static/css/xadmin.css">
        <script type="text/javascript" src="/static/js/jquery.min.js"></script>
        <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="/static/js/xadmin.js"></script>
    </head>
    <body>
    <div class="x-body layui-anim layui-anim-up">
        {%if ContentInfo %}
        <blockquote class="layui-elem-quote">请及时回执！！！</blockquote>
        <table class="layui-table">
            <thead>
              <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>单位</th>
                <th>部门</th>
                <th>手机号码</th>
                <th>集团短号</th>
                <th>备注（新增/删除/改号）</th>
                <th>办理时间</th>
                <th>操作</th>
            </thead>
            <tbody>
              {% for item in ContentInfo %}
              <tr>
                <td>{{ item.id_rm }}</td>
                <td>{{ item.user_name }}</td>
                <td>{{ item.user_company }}</td>
                <td>{{ item.user_part }}</td>
                <td>{{ item.phone_number }}</td>
                <td>{{ item.short_number }}</td>
                <td>{{ item.edit_remark }}</td>
                <td>{{ item.status_time }}</td>
                <td class="td-manage">
                  <a title="回执成功" onclick="hz_success(this,'{{ item.id }}_{{ item.type }}')" href="javascript:;">
                    <i class="layui-icon">&#x1005;</i>
                  </a>
                  <a title="回执失败" onclick="hz_fail(this,'{{ item.id }}_{{ item.type }}')" href="javascript:;">
                    <i class="layui-icon">&#x1007;</i>
                  </a>
                </td>
              </tr>
              {% endfor %}
            </tbody>
          </table>
        {% endif %}
        </div>
<script>
          layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });
      });
        function hz_success(obj,id){
        layer.confirm('确认回执成功？',function(index){
            //发异步删除数据
                $.ajax({
                url:'/hz_success/',
                method:'post',
                dataType:'json',
                data: {hz_data:id},
                success:function(res){
                    if(res.status=='success'){
                        layer.msg(res.msg, {icon: 6},function (index) {
                            location.replace(location.href);
                        })
                    }else if(res.status=='fail'){
                        layer.msg(res.msg, {icon: 7},function (index) {
                        });
                }
                },
                error:function(){
                    layer.msg(res.msg, {icon: 7},function (index) {
                        });
                }
            });
            return false;
        });
    }
    function hz_fail(obj,id){
        layer.confirm('确认回执失败？',function(index){
            //发异步删除数据
                $.ajax({
                url:'/hz_fail/',
                method:'post',
                dataType:'json',
                data: {hz_data:id},
                async:true,
                success:function(res){
                    if(res.status=='success'){
                        layer.msg(res.msg, {icon: 6},function (index) {
                        })
                    }else if(res.status=='fail'){
                        layer.msg(res.msg, {icon: 7},function (index) {
                        });
                }
                },
                error:function(){
                    layer.msg(res.msg, {icon: 7},function (index) {
                        });
                }
            });
            return false;
        });
    }
    </script>
</body>
</html>